package structure;

import java.io.IOException;
import java.util.Iterator;

import Util.StdOut;

public class StructureApp {

    public static void main(String[] args) throws IOException {
        //Stack
        Stack stack = new Stack();
        stack.push('a');
        stack.push('b');
        stack.push('c');
        stack.push('d');
        
//        StdOut.println(stack.peek());
//        StdOut.println(stack.pop());
        //traverse stack
//        Iterator iterator = stack.iterator();
//        while(iterator.hasNext()) {
//            StdOut.printf(iterator.next() + " ");
//        }
        
        //PriorityQ
        PriorityQ thePQ = new PriorityQ(5);
        thePQ.insert(30);
        thePQ.insert(50);
        thePQ.insert(10);
        thePQ.insert(40);
        thePQ.insert(20);
        while (!thePQ.isEmpty()) {
            int item = thePQ.peek();
            System.out.print(item + " "); // 10, 20, 30, 40, 50
        } // end while
        System.out.println("");
        int result= ((2+4)*7) + 3*(9-5);
        System.out.println(result);
    }
}
